package com.kpf.springcloud.controller;

import com.kpf.springcloud.common.ResultJson;
import com.kpf.springcloud.pojo.KpfTopic;
import com.kpf.springcloud.pojo.PageResult;
import com.kpf.springcloud.service.IKpfTopicCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author shiwen
 * @date 2021/3/8
 */
@RestController
public class KpfTopicCollectController {

    @Autowired
    private IKpfTopicCollectService kpfTopicCollectService;

    @PostMapping("/collect/collectTopic")
    public ResultJson collectTopic(int topicId, int collectStatus) {
        kpfTopicCollectService.collectTopic(topicId, collectStatus);
        return ResultJson.ok();
    }

    @GetMapping("/collect/getCollectListByUserId")
    public ResultJson<List<KpfTopic>> getCollectListByUserId() {
        return ResultJson.ok(kpfTopicCollectService.getCollectListByUserId());
    }

}